package com.example.xm.controller;

import com.example.xm.entity.Userentity;
import com.example.xm.entity.vo.UserVo;
import com.example.xm.service.UserService;
import com.example.xm.web.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/web")
public class WebController {
    @Autowired
    UserService userService;
    @PostMapping("/login")
    public Result login(@RequestBody Userentity user){
//        System.out.println(account+"=========="+password);
        UserVo vo= userService.weblogin(user.getName(), user.getPassword());
        return Result.success(vo);

    }

}
